<?php 



	
	$num1 = isset($_POST['num1']) ? (int)$_POST['num1'] : 0;
	$num2 = isset($_POST['num2']) ? (int)$_POST['num2'] : 0;
	
	$operation = isset($_POST['operation']) ? $_POST['operation'] : '+';
	switch ($operation) {
		case '+':
			$result = $num1 + $num2;
			break;
		case '-':
			$result = $num1 - $num2;
			break;
		case '*':
			$result = $num1 * $num2;
			break;
		case '/':
			$result = $num1 / $num2;
			break;
		default:
			
			break;
	}





 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
 	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
 	<title>Document</title>
 	<style type="text/css">
     *{
 		padding: 0 ;
 		margin: 0;
 	}
 	
    div.box{
      width: 120px;
      height: 150px;
      margin: 30px auto;
      background: #141414;
      border: solid 3px #5D6974;
      border-radius: 3%;
      color: white;
    }
    div.box .xianshi{
    	width: 116px;
    	height: 30px;
    	background: #95DF94;
    	margin: 2px auto;
    	border-radius: 5%;

    }
    div.box .xianshi h2{
    	display: block;
    	float: right;
    	color: #000;
    }

    div.box .anjian{
    	width: 116px;
    	height: 110px;
    	
    	margin: 5px auto;
    }
    div.box .anjian form h6{
    	color: white;
    }
    div.box .anjian form input.i1{
    	width: 115px;
    }
 	</style>
 </head>
 <body>
    <div></div>
 	
 	
 	
 	
 	<div class="box">
 	    <div class="xianshi">
 	        <h2><?php echo $result ?> </h2>
 	    </div>
 	    <div class="anjian">
 	      <form action="" method="post">
 		    <h6>数字1：</h6>
 		    <input class="i1" type="text" name="num1" id="" />
 		    <br />
 		    <h6>数字2：</h6>
 		    <input class="i1" type="text" name="num2" id="" />
 		    <br />
 		    <h6>运算符：</h6>
 		    <input type="radio" name="operation" id="" checked="" value="+"/>+
 		    <input type="radio" name="operation" id="" value="-"/>-
 		    <input type="radio" name="operation" id="" value="*"/>*
 		    <input type="radio" name="operation" id="" value="/"/>/
 		    <br />
 		    <input type="submit" value="运算"/>
 	      </form>
 	    </div>
 		
 	</div>
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 	
 </body>
 </html>